<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>系统首页</title>

    <script src="/jquery-1.8.3.min.js"></script>
    <script src="/login.js"></script>

</head>

<body>
<h1>欢迎来到系统首页！</h1>
<button type="button" id="delete">删除</button> | <button type="button" id="update">修改</button>

<script>
    $(function () {
        $("#delete").click(function () {
            $.ajax({
                url: "/users/delete",
                type: "post",
                async: false,
                cache: false,
                dataType: "json",
                "success": function (obj) {
                    if (obj.state=='1') {
                        alert(obj.data);
                    }else{
                        alert(obj)
                    }
                }
            })
        });
        $("#update").click(function () {
            $.ajax({
                url: "/users/update",
                type: "post",
                async: false,
                cache: false,
                dataType: "text",
                "success": function (obj) {


                        alert(obj)

                }
            })
        });

    });
</script>
</body>
</html>